import { Router } from 'express';
import articleRoutes from './articles';
import categoryRoutes from './categories';
import caseRoutes from './cases';
import productRoutes from './productRoutes';
import adminRoutes from './adminRoutes';
import wechatRoutes from './wechat';

const router = Router();

// === 用户端接口 (无需认证) ===
router.use('/api/web/articles', articleRoutes);
router.use('/api/web/categories', categoryRoutes);
router.use('/api', caseRoutes);
router.use('/api', productRoutes);
router.use('/api/wechat', wechatRoutes);

// === 后端接口 (需要认证) ===
router.use('/api/admin', adminRoutes);

// 健康检查
router.get('/health', (req, res) => {
  res.json({ status: 'OK', timestamp: new Date().toISOString() });
});

export default router; 